package com.example.mybatis_demo.mapper;

import com.example.mybatis_demo.entity.ArticleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {

    @Select("select a.*,u.username from articleinfo a left join userinfo u on a.uid=u.id ;")
    List<ArticleEntity> getAll();

    @Select("select * from articleinfo where uid=#{uid}")
    List<ArticleEntity> getListByUid(@Param("uid")Integer uid);
}
